package com.sim.storage

import android.os.Parcelable
import com.sim.storage.enums.EXTRAEnum
import com.sim.storage.enums.MILKTYPEEnum
import com.sim.storage.enums.SizeEnum
import kotlinx.parcelize.Parcelize


data class GoodsBeanParent(val goods: List<GoodList>)

data class GoodList(val category: String, val list: List<GoodsBean>)

@Parcelize
data class GoodsBean(
    val name: String,
    val urlId: Int,
    val price: Float,
    var isSelect: Boolean = false,
    var count: Int,
    var sizeEnum: SizeEnum,
    var extraEnum: EXTRAEnum,
    var milktypeEnum: MILKTYPEEnum
) : Parcelable {
    fun getPrice(): String {
        return (price * sizeEnum.base * extraEnum.base * milktypeEnum.base).toString()
    }

    fun getPriceFloat(): Float {
        return (price * sizeEnum.base * extraEnum.base * milktypeEnum.base)
    }

    fun getDes(): String {
        return "${sizeEnum.title}、${extraEnum.title}、${milktypeEnum.title}"
    }
}
